As cloud computing develops rapidly, a higher requirement is imposed on a processing capability of a protocol stack instance. Currently, because a manner in which multiple protocol stack instances share a socket is usually used, there exists a problem that multiple protocol stack instances contend for one socket, and therefore, parallel protocol stack instances in a multi-core central processing unit (CPU) architecture are put forward. The parallel protocol stack instances include at least two protocol stack instances, and each protocol stack instance runs on a virtual central processing unit (VCPU) of a CPU, and uses a manner of exclusively occupying a socket associated with the protocol stack instance, to avoid the foregoing problem that multiple protocol stack instances contend for one socket. When a network adapter distributes data packets to protocol stack instances according to a distribution policy, the protocol stack instances may perform protocol processing in parallel on the data packets using sockets associated with the protocol stack instances.
However, when an application instructs to create a socket needed to perform the foregoing protocol processing, the application specifies an association relationship between a socket and a protocol stack instance. In this way, only an associated protocol stack instance can occupy the socket to perform protocol processing on a data packet, and when a protocol stack instance to which a network adapter distributes a data packet is different from a protocol stack instance associated with the socket, that is, a case in which a protocol stack instance specified by an application conflicts with a protocol stack instance specified by a network adapter occurs, protocol processing cannot be performed on the data packet.